#ifndef MATTISEVFS_H
#define MATTISEVFS_H

/***************************************************************************
 * Constants
 ***************************************************************************/

#define SIGTERM			0
#define VFS_OPEN		1
#define VFS_READ		2
#define VFS_WRITE		3
#define VFS_SEEK		4
#define VFS_GETC		5
#define VFS_PUTC		6
#define VFS_CLOSE		7
#define VFS_MOUNT		8
#define VFS_UMOUNT		9
#define VFS_REPMSG		10
#define VFS_INITTHRD	11
#define VFS_NOTRDY		12
#define VFS_STAT		13

/***************************************************************************
 * Types
 ***************************************************************************/

// An action to perform
struct vfs_Action {
	int msgcode; // backup message code
	char filenm[255]; // filename to work with (optional)
	int nmlen; // filename length
	int descriptor; // descriptor
	int vfsArg1; // argument 1
	int vfsArg2; // argument 2
	int vfsArg3; // argument 3
};

// Request data - either a reply or a message
struct vfs_ReqData {
	int msgcode; // backup message code
	int descriptor; // descriptor to work with
	char data[0x500]; // a maximum of a page of data only
	int datlen; // length of data
	int srcpid; // source process id
	int reqArg1; // argument 1
	int reqArg2; // argument 2
	int reqArg3; // argument 3
};

// A mount point
struct vfs_MountPoint {
	char prefix[32]; // the prefix, for instance devfs might use '/dev/'
	int preflen; // prefix length
	int handler_pid; // handler's PID
	int state; // used or not?
};

// A descriptor
struct vfs_Descriptor {
	int handler_pid; // all operations are forwarded to this process
	int state; // used or not?
	int internal_desc; // the filesystem's intenal descriptor
} descriptors[1024];

#endif
